package main.java.com.uycode.generic;

import java.util.*;

import static javafx.scene.input.KeyCode.T;
import static javafx.scene.input.KeyCode.V;

public class NonGeneric {

    Collection<Number> myNumbers() {return null;}


}
abstract class RawMembers<T> extends NonGeneric implements Collection<String> {
    static Collection<NonGeneric> cng = new ArrayList<NonGeneric>();

}

class MiscMath<T extends Number> {
    static int divisor;

    MiscMath(int divisor) { this.divisor = divisor;}

    static float ratio(long l) {
        try {
            l /= divisor;
        } catch (Exception e) {
            if (e instanceof ArithmeticException) {
                l = Long.MAX_VALUE;
            } else {
                l = 0;
            }
        }
        return (float)l;
    }

    static double gausser () {
        Random r = new Random();
        double[] val = new double[2];
        val[0] = r.nextGaussian();
        val[1] = r.nextGaussian();
        return (val[0] + val[1]) / 2;
    }

    static Collection<Number> fromArray (Number[] na) {
        Collection<Number> cn = new ArrayList<Number>();
        for (Number n: na
             ) {
            cn.add(n);
        }
        return cn;
    }

    <S> void loop(S s) {
        this.<S>loop(s);
    }

    public static void main(String[] args) {
        float test1 = ratio(12L);

        double test2 = gausser();

        List list = null;
        Number[] numbers = (Number[]) list.toArray(new Number[list.size()]);

    }
}
